package cn.wolfcode.vo;

import lombok.Getter;
import lombok.Setter;
import org.junit.Test;

import java.util.HashMap;
import java.util.Map;

/**
 * @Description: 映射思想, 映射实体类, 用于做查询范围内查询
 * @Author: 伍家钰
 * @Date: 2020/8/14 22:51
 * @Version: 1.0
 */
@Getter
@Setter
public class TravelCondition {
    /**
     * 映射接口用于key----->value:{1,[2,3]}类型的数据
     */
    public static final Map<Integer, TravelCondition> DAY_MAP = new HashMap<>();
    /**
     * 人均花费的关系映射接口
     */
    public static final Map<Integer, TravelCondition> PEREXPENDTYPE_MAP = new HashMap<>();

    public static final Map<Integer, String> ORDERTYPE_MAP = new HashMap<>();

    static {
        DAY_MAP.put(1, new TravelCondition(1, 3));
        DAY_MAP.put(2, new TravelCondition(4, 7));
        DAY_MAP.put(3, new TravelCondition(8, 14));
        DAY_MAP.put(4, new TravelCondition(15, Integer.MAX_VALUE));
        PEREXPENDTYPE_MAP.put(1, new TravelCondition(1, 999));
        PEREXPENDTYPE_MAP.put(2, new TravelCondition(1000, 6000));
        PEREXPENDTYPE_MAP.put(3, new TravelCondition(6001, 20000));
        PEREXPENDTYPE_MAP.put(4, new TravelCondition(20001, Integer.MAX_VALUE));
        ORDERTYPE_MAP.put(1, "createTime");
        ORDERTYPE_MAP.put(2, "viewnum");
    }

    private int min;
    private int max;

    private TravelCondition(int min, int max) {
        this.min = min;
        this.max = max;
    }
}


